import { Platform } from '@/modules/businessModule/platform/assets/platform.entity';
import { Spec } from '@/modules/businessModule/spec/assets/spec.entity';
import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from 'typeorm';

@Entity('specstype')
export class SpecsType {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  @ApiProperty({ description: '规格属性名称' })
  specsTypeName: string;

  @ManyToOne(() => Platform, (platForm) => platForm.specsType)
  @ApiProperty({ description: '商品', type: () => Platform })
  platForm: Platform;

  @OneToMany(() => Spec, (specs) => specs.specsType)
  @ApiProperty({ description: '规格属性', type: () => Spec })
  specs: Spec[];
}
